<?php

/**
 * Cliente form base class.
 *
 * @package    tvpv
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseClienteForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'user_id'    => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'nombre'     => new sfWidgetFormInput(),
      'apellido_p' => new sfWidgetFormInput(),
      'apellido_m' => new sfWidgetFormInput(),
      'usuario'    => new sfWidgetFormInput(),
      'password'   => new sfWidgetFormInput(),
      'birthday'   => new sfWidgetFormDate(),
      'telefono'   => new sfWidgetFormInput(),
      'email'      => new sfWidgetFormInput(),
      'tipo'       => new sfWidgetFormInput(),
      'fecha'      => new sfWidgetFormDate(),
      'activo'     => new sfWidgetFormInputCheckbox(),
    ));
    
    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Cliente', 'column' => array('usuario')))
    );
    
    
    $this->setValidators(array(
      'id'         => new sfValidatorPropelChoice(array('model' => 'Cliente', 'column' => 'id', 'required' => false)),
      'user_id'    => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'nombre'     => new sfValidatorString(array('max_length' => 20)),
      'apellido_p' => new sfValidatorString(array('max_length' => 20)),
      'apellido_m' => new sfValidatorString(array('max_length' => 20)),
      'usuario'    => new sfValidatorString(array('max_length' => 20)),
      'password'   => new sfValidatorString(array('max_length' => 20)),
      'birthday'   => new sfValidatorDate(array('required' => false)),
      'telefono'   => new sfValidatorString(array('max_length' => 15)),
      'email'      => new sfValidatorString(array('max_length' => 50)),
      'tipo'       => new sfValidatorString(),
      'fecha'      => new sfValidatorDate(),
      'activo'     => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('cliente[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Cliente';
  }


}
